import { ToolbarItem } from './editor';

export interface Plugin {
  name: string;
  install: (options?: any) => void;
  hooks?: PluginHooks;
  toolbar?: ToolbarItem[];
}

export interface PluginHooks {
  beforeInit?: (editor: any) => void;
  afterInit?: (editor: any) => void;
  beforeRender?: (markdown: string) => string;
  afterRender?: (html: string) => string;
  beforeInsert?: (text: string) => string;
  afterInsert?: (text: string) => void;
}

export interface PluginContext {
  editor: any;
  options: any;
  registerHook: (name: string, callback: Function) => void;
  registerToolbar: (items: ToolbarItem[]) => void;
}